const Base = require('./base.js');

module.exports = class extends Base {
  indexAction() {
    return this.display();
  }
  async listAction() {
    const categoryId = 1;
    const pageInfo = this.pageInfo();
    const albumModel = this.model('album');
    this.assign('pagerObj', think.createPager(
      await albumModel.queryDataCount({
        categoryId
      }),
      await albumModel.queryDataOfPage(pageInfo, {
        categoryId
      }, 'cover,title'),
      pageInfo));
    return this.display();
  }
};
